/*
 *    Copyright (c) 2018-2025, cloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: cloud
 */

package com.fuyao.cloud.space.position.service;

import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNode;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuyao.cloud.common.core.util.R;
import com.fuyao.cloud.space.entity.RoomPosition;
import com.fuyao.cloud.space.vo.RoomPositionExportVO;
import com.fuyao.cloud.space.vo.PositionVO;


import java.util.List;

/**
 * 位置管理
 *
 * @author 时间的朋友
 * @date 2021-11-16 19:23:41
 */
public interface RoomPositionService extends IService<RoomPosition> {

    /**
    *  自定义导出
    * @return
    */
    List<RoomPositionExportVO> listExcel(RoomPosition fyRoomPosition);

	/**
	 * 位置树形信息
	 * @return
	 */
	 List<Tree<Long>> selectTree(QueryWrapper<RoomPosition> queryWrapper);

	/**
	 * 判断是否还存在子数据
	 * @return
	 */
	R judgeChilden();

	/**
	 * 查询位置信息
	 * @param id id
	 * @return 包含房间信息的位置对象
	 */
	PositionVO getPositionById(Long id);

	/**
	 * 查询位置信息集合
	 * @return 位置信息集合
	 */
	List<PositionVO> listPositionVO();

	/**
	 * 获取树形节点
	 * @return
	 */
	List<TreeNode<String>> getTreeNode();

	/**
	 * 点击树形菜单查询数据
	 * @param page        前端分页
	 * @param id          可以是自己的id，也肯能时父类的id
	 * @param affiliName  所属模块名称
	 * @return
	 */
	Page<RoomPosition> getTreePage(Page page, Long id, String affiliName);

	/**
	 * 根据父id 查询参数
	 * @param id
	 * @param affiliName
	 * @return
	 */
	List<Long> getTreeParam(Long id, String affiliName);

	/**
	 * 懒加载树
	 * @param houseId “HOUSE-id”
	 * @return
	 */
	List<Tree<String>> lazyTree(String houseId);

	/**
	 * 懒加载树
	 * @param houseId 房间id
	 * @return
	 */
	List<Tree<String>> lazyTree(Long houseId);
}
